#ifndef LOGINFUNCTIONALITY_H
#define LOGINFUNCTIONALITY_H

#include "Modules/ModuleInterface.h"
#include "Modules/NetWorkInterface.h"
#include "functionalityInterface.h"

class loginFunctionality : public FunctionalityInterface
{
    Q_OBJECT
public:
    loginFunctionality(std::shared_ptr<NetworkInterface> network,
                       std::shared_ptr<ModuleInterface> module);
    bool executeFunction() override;
    void setParameters(const QString &phoneNumber, const QString &passwd);

protected slots:
    void onDataArrival(qint64 readBytes);
signals:
    void loginSuccessed(QString data);
    void loginFailed(QString data);

private:
    // bool isLoginSuccessful(const QString &data);

private:
    std::shared_ptr<NetworkInterface> m_network;
    std::shared_ptr<ModuleInterface> m_module;
};

#endif // LOGINFUNCTIONALITY_H
